package com.example.java_message_queue.mqclient;

import java.io.IOException;
import java.net.Socket;

public class ConnectionFactory {
    // BrokerServer 的 ip 和 port
    private String host;
    private int port;
    // 这几个部分暂时不加.
//    private String virtualHost;
//    private String username;
//    private String password;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    // 建立一个 tcp 连接
    public Connection newConnection() throws IOException {
        Connection connection = new Connection(host, port);
        return connection;
    }
}
